package com.eric.demo.kafka;

import com.codahale.metrics.Counter;
import com.codahale.metrics.MetricRegistry;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ZhangGuangyin on 2018/8/9
 */
public class Main {

    public static void main(String[] argvs) throws InterruptedException {
        MetricRegistry registry = new MetricRegistry();
        Counter counter = registry.counter("receive");
        List<String> topicList = new ArrayList<>();
        topicList.add("zgy_test");

        for(int i=0;i<Constants.PARTIRIONS;i++){
            Consumer consumer = new Consumer(topicList, counter);
            new Thread(consumer).start();
        }

        while (true){
            System.out.println("count:" + counter.getCount());
            Thread.sleep(2000l);
        }
    }
}
